package com.example.springcloudwinter.token;

import io.jsonwebtoken.SignatureAlgorithm;

import java.util.HashMap;
import java.util.Map;

public class JWTProperties implements JWTPropertiesInterface {

    public final Map<String,Object> header=new HashMap<>();

    public final SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;// 使用SHA256withDSA加密算法
    public String secret;

    public Long access_token_expiration;

    public String jwt_iss;

    public String subject;
    JWTProperties(){
        header.put("alg", "HS256");//初始化header
        header.put("typ", "JWT");
    }


    @Override
    public Map<String, Object> getHeader() {
        return header;
    }

    @Override
    public SignatureAlgorithm getSignatureAlgorithm() {
        return signatureAlgorithm;
    }

    @Override
    public String getSecret() {
        return secret;
    }

    @Override
    public Long getAccessTokenExpiration() {
        return access_token_expiration;
    }

    @Override
    public String getJwtIss() {
        return jwt_iss;
    }

    @Override
    public String getSubject() {
        return subject;
    }
}
